import { BrowserWindow } from 'electron'

// 发送消息给渲染进程
const sendMsgToRenderer = (chanel: string, message?: any) => {
  const windows = BrowserWindow.getAllWindows()
  windows.forEach((window) => {
    if (!window.isDestroyed()) {
      window.webContents.send(chanel, message)
    }
  })
}

export default sendMsgToRenderer
